import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    {
      path: '/home',
      component: () => import('../views/home/index.vue'),
      redirect: '/home/index',
      children: [
        {
          path: 'index',
          component: () => import('../views/home/pages/index/index.vue'),
          meta: {
            title: "首页"
          }
        },
        {
          path: 'singer',
          component: () => import('../views/home/pages/singer'),
          meta: {
            title: "歌手"
          }
        },
        {
          path: 'album',
          component: () => import('../views/home/pages/album'),
          meta: {
            title: "新碟上架"
          }
        },
        {
          path: 'toplist',
          component: () => import('../views/home/pages/toplist'),
          meta: {
            title: "排行榜"
          }
        },
        {
          path: 'category',
          component: () => import('../views/home/pages/category'),
          meta: {
            title: "分类歌单"
          }
        },
        {
          path: 'mv',
          component: () => import('../views/home/pages/mv'),
          meta: {
            title: "MV"
          }
        },
      ]
    },
    {
      path: "/mymusic",
      component: () => import("../views/mymusic"),

    },
    {
      path: "/player",
      component: () => import("../views/player")
    }
  ]
})

export default router
